USE loghog;
GO
CREATE TRIGGER Deleting ON Value
AFTER DELETE
AS
BEGIN
	SET NOCOUNT ON;
	SET IDENTITY_INSERT Value ON;
	INSERT INTO Value (ID, BLOB, Time, JournalID, Deleted, Draft) 
	SELECT ID, BLOB, Time, JournalID, Deleted=1, Draft 
	FROM deleted;
	SET IDENTITY_INSERT Value OFF;
END
GO